﻿#region Usings

using System.Windows.Controls;
using System.Windows.Media;

#endregion

namespace SilverBox.Controls
{
    public class CoverFlowItemControl : ContentControl
    {
        public CoverFlowItemControl()
        {
            DefaultStyleKey = typeof (CoverFlowItemControl);
        }

        public PlaneProjection PlaneProjection { get; set; }
        public ScaleTransform ScaleTransform { get; set; }
        public TranslateTransform TranslateTransform { get; set; }

        public double XOffset
        {
            get
            {
                if (ActualWidth > 0)
                    return ActualWidth/2;
                return 0;
            }
        }

        public override void OnApplyTemplate()
        {
            PlaneProjection = (PlaneProjection) GetTemplateChild("Rotator");
            ScaleTransform = (ScaleTransform) GetTemplateChild("scaleTransform");
            TranslateTransform = (TranslateTransform) GetTemplateChild("translateTransform");
        }
    }
}